package thread;

public class ThreadInfoDemo {
    public static void main(String[] args) {
        Thread main=Thread.currentThread();
        System.out.println(main);
        doSome();
    }
    public static void doSome(){
        Thread t=Thread.currentThread();
        System.out.println("运行doSome方法的线程:"+t);

        System.out.println("线程名字:"+t.getName());
        System.out.println("线程唯一标识:"+t.getId());
        System.out.println("线程优先级:"+t.getPriority());

        System.out.println("线程是否活着:"+t.isAlive());
        System.out.println("线程是否为守护线程:"+t.isDaemon());
        System.out.println("线程是否被中断:"+t.isInterrupted());
    }
}

























